package com.seanchenxi.gwt.wordpress.json.service.model.impl;

import java.util.ArrayList;

import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;
import com.seanchenxi.gwt.wordpress.json.service.model.Attachment;
import com.seanchenxi.gwt.wordpress.json.service.model.WpImage;
import com.seanchenxi.gwt.wordpress.json.service.util.JsUtil;

public class AttachmentImpl extends JavaScriptObject implements Attachment {

	protected AttachmentImpl() {
	}

	@Override
	public final native int getId() /*-{
		return this.id;
	}-*/;

	@Override
	public final native void setId(int id) /*-{
		this.id = id;
	}-*/;

	@Override
	public final native String getURL() /*-{
		return this.url;
	}-*/;

	@Override
	public final native void setURL(String url)/*-{
		this.url = url;
	}-*/;

	@Override
	public final native String getSlug()/*-{
		return this.slug;
	}-*/;

	@Override
	public final native void setSlug(String slug)/*-{
		this.slug = slug;
	}-*/;

	@Override
	public final native String getTitle()/*-{
		return this.title;
	}-*/;

	@Override
	public final native void setTitle(String title)/*-{
		this.title = title;
	}-*/;

	@Override
	public final native String getDescription() /*-{
		return this.description;
	}-*/;

	@Override
	public final native void setDescription(String description) /*-{
		this.description = description;
	}-*/;

	@Override
	public final native String getCaption() /*-{
		return this.caption;
	}-*/;

	@Override
	public final native void setCaption(String caption) /*-{
		this.caption = caption;
	}-*/;

	@Override
	public final native int getParentId() /*-{
		return this.parent;
	}-*/;

	@Override
	public final native void setParentId(int parentId) /*-{
		this.parent = parentId;
	}-*/;

	@Override
	public final native String getMimeType() /*-{
		return this.mime_type;
	}-*/;

	@Override
	public final native void setMimeType(String mimeType) /*-{
		this.mime_type = mimeType;
	}-*/;


	private final native JsArray<WpImageImpl> getJsArrayImages() /*-{
		return this.images;
	}-*/;

	private final native void setJsArrayImages(JsArray<WpImageImpl> images) /*-{
		this.parent = images;
	}-*/;

	@Override
	public final ArrayList<WpImage> getImages() {
		return JsUtil.convert(getJsArrayImages());
	}

	@Override
	public final void setImages(ArrayList<WpImage> images) {

	}

}
